package com.example.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.example.dto.OrderCreateDTO;
import com.example.entity.Coupon;
import com.example.entity.UserCoupon;
import com.example.vo.Result;
import com.example.vo.UserCouponVO;
import jakarta.validation.constraints.NotNull;

import java.time.LocalDateTime;
import java.util.List;

/**
* @author circle48
* @description 针对表【user_coupon(用户优惠券关联表)】的数据库操作Service
* @createDate 2024-05-17 14:37:16
*/
public interface UserCouponService extends IService<UserCoupon> {

    Result getMemberCoupons(Integer pageNum, Integer pageSize, String couponStatus, Long id);

    Result getCouponsByStore(Long id, Long storeId);

    Result receiveBuyerCoupon(@NotNull(message = "优惠券ID不能为空") Long couponId, Long id);



    void checkAndCreateUserCoupon(Coupon coupon, Long userId);


    List<UserCoupon> queryMyCoupon();

    UserCouponVO getCouponsById(Long couponId);

    List<UserCouponVO> getCouponsByIds(List<Long> couponIds);

    void updateCouponStatusToUsed(Long couponId, Long id, String orderSn);

    void updateCouponStatusToUnUsed(List<OrderCreateDTO> orders);

    void updateExpiredUserCoupons(LocalDateTime now);
}
